<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <h:form id="valutaSearch" styleClass="edit">
    
        <rich:simpleTogglePanel label="Parametri pretrage:" switchType="ajax">
        
            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">naziv</ui:define>
                <h:inputText id="naziv" value="#{valutaList.valuta.naziv}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">oznaka</ui:define>
                <h:inputText id="oznaka" value="#{valutaList.valuta.oznaka}"/>
            </s:decorate>

            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">sifra</ui:define>
                <h:inputText id="sifra" value="#{valutaList.valuta.sifra}"/>
            </s:decorate>

        
        </rich:simpleTogglePanel>
        
        <div class="actionButtons">
            <h:commandButton id="search" value="Search" action="/ValutaList.xhtml"/>
        </div>
        
    </h:form>
    
    <rich:panel>
        <f:facet name="header">Rezultati pretrage:</f:facet>
    <div class="results" id="valutaList">

    <h:outputText value="The valuta search returned no results." 
               rendered="#{empty valutaList.resultList}"/>
               
    <rich:dataTable id="valutaList" 
                var="valuta"
              value="#{valutaList.resultList}" 
           rendered="#{not empty valutaList.resultList}">

        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="naziv #{valutaList.order=='naziv asc' ? messages.down : ( valutaList.order=='naziv desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{valutaList.order=='naziv asc' ? 'naziv desc' : 'naziv asc'}"/>
                </s:link>
            </f:facet>
            #{valuta.naziv}
        </h:column>
        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="oznaka #{valutaList.order=='oznaka asc' ? messages.down : ( valutaList.order=='oznaka desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{valutaList.order=='oznaka asc' ? 'oznaka desc' : 'oznaka asc'}"/>
                </s:link>
            </f:facet>
            #{valuta.oznaka}
        </h:column>
        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="sifra #{valutaList.order=='sifra asc' ? messages.down : ( valutaList.order=='sifra desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{valutaList.order=='sifra asc' ? 'sifra desc' : 'sifra asc'}"/>
                </s:link>
            </f:facet>
            #{valuta.sifra}
        </h:column>
        <h:column>
            <f:facet name="header">action</f:facet>
            <s:link view="/#{empty from ? 'Valuta' : from}.xhtml" 
                   value="Select" 
                      id="valuta">
                <f:param name="valutaId" 
                        value="#{valuta.id}"/>
            </s:link>
        </h:column>
    </rich:dataTable>

    </div>
    </rich:panel>
    
    <div class="tableControl">
      
        <s:link view="/ValutaList.xhtml" 
            rendered="#{valutaList.previousExists}" 
               value="#{messages.left}#{messages.left} First Page"
                  id="firstPage">
          <f:param name="firstResult" value="0"/>
        </s:link>
        
        <s:link view="/ValutaList.xhtml" 
            rendered="#{valutaList.previousExists}" 
               value="#{messages.left} Previous Page"
                  id="previousPage">
            <f:param name="firstResult" 
                    value="#{valutaList.previousFirstResult}"/>
        </s:link>
        
        <s:link view="/ValutaList.xhtml" 
            rendered="#{valutaList.nextExists}" 
               value="Next Page #{messages.right}"
                  id="nextPage">
            <f:param name="firstResult" 
                    value="#{valutaList.nextFirstResult}"/>
        </s:link>
        
        <s:link view="/ValutaList.xhtml" 
            rendered="#{valutaList.nextExists}" 
               value="Last Page #{messages.right}#{messages.right}"
                  id="lastPage">
            <f:param name="firstResult" 
                    value="#{valutaList.lastFirstResult}"/>
        </s:link>
        
    </div>
    
    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/ValutaEdit.xhtml"
                    id="create" 
                 value="Create valuta">
            <f:param name="valutaId"/>
        </s:button>
    </s:div>
    
</ui:define>

</ui:composition>

